import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store/index";
import Antd from "ant-design-vue";
import "ant-design-vue/dist/antd.css"; // 使用antdesign
import { ConfigProvider } from "ant-design-vue";
import "@/assets/style/common.css"; // 公共样式
import axios from "axios";

// axios 配置
axios.defaults.timeout = 500000;

Vue.component(ConfigProvider.name, ConfigProvider);
Vue.use(Antd);
Vue.config.productionTip = false;

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount("#app");

//前置拦截，添加请求头
axios.interceptors.request.use(config =>{
  store.commit('showLoading',true);
  return config
})

axios.interceptors.response.use(config=>{
  store.commit('showLoading',false)
  return config
})